.TH "gdaldem" 1 "Mon Apr 25 2016" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
gdaldem \- gdaldem 
Tools to analyze and visualize DEMs\&. (since GDAL 1\&.7\&.0)
.SH "SYNOPSIS"
.PP
.PP
.PP
.nf
- To generate a shaded relief map from any GDAL-supported elevation raster :
    gdaldem hillshade input_dem output_hillshade
                [-z ZFactor (default=1)] [-s scale* (default=1)]"
                [-az Azimuth (default=315)] [-alt Altitude (default=45)]
                [-alg ZevenbergenThorne] [-combined]
                [-compute_edges] [-b Band (default=1)] [-of format] [-co "NAME=VALUE"]* [-q]

- To generate a slope map from any GDAL-supported elevation raster :
    gdaldem slope input_dem output_slope_map"
                [-p use percent slope (default=degrees)] [-s scale* (default=1)]
                [-alg ZevenbergenThorne]
                [-compute_edges] [-b Band (default=1)] [-of format] [-co "NAME=VALUE"]* [-q]

- To generate an aspect map from any GDAL-supported elevation raster
  Outputs a 32-bit float raster with pixel values from 0-360 indicating azimuth :
    gdaldem aspect input_dem output_aspect_map"
                [-trigonometric] [-zero_for_flat]
                [-alg ZevenbergenThorne]
                [-compute_edges] [-b Band (default=1)] [-of format] [-co "NAME=VALUE"]* [-q]

- To generate a color relief map from any GDAL-supported elevation raster
    gdaldem color-relief input_dem color_text_file output_color_relief_map
                [-alpha] [-exact_color_entry | -nearest_color_entry]
                [-b Band (default=1)] [-of format] [-co "NAME=VALUE"]* [-q]
    where color_text_file contains lines of the format "elevation_value red green blue"
    
- To generate a Terrain Ruggedness Index (TRI) map from any GDAL-supported elevation raster:
    gdaldem TRI input_dem output_TRI_map
                [-compute_edges] [-b Band (default=1)] [-of format] [-q]
            
- To generate a Topographic Position Index (TPI) map from any GDAL-supported elevation raster:
    gdaldem TPI input_dem output_TPI_map
                [-compute_edges] [-b Band (default=1)] [-of format] [-q]
            
- To generate a roughness map from any GDAL-supported elevation raster:
    gdaldem roughness input_dem output_roughness_map
                [-compute_edges] [-b Band (default=1)] [-of format] [-q]

Notes :
  gdaldem generally assumes that x, y and z units are identical.  If x (east-west)
  and y (north-south) units are identical, but z (elevation) units are different, the
  scale (-s) option can be used to set the ratio of vertical units to horizontal.  For 
  LatLong projections near the equator, where units of latitude and units of 
  longitude are similar, elevation (z) units can be converted to be compatible
  by using scale=370400 (if elevation is in feet) or scale=111120 (if elevation is in 
  meters).  For locations not near the equator, it would be best to reproject your
  grid using gdalwarp before using gdaldem..fi
.PP
 
.SH "DESCRIPTION"
.PP
This utility has 7 different modes : 
.IP "\fB\fBhillshade\fP\fP" 1c
to generate a shaded relief map from any GDAL-supported elevation raster 
.IP "\fB\fBslope\fP\fP" 1c
to generate a slope map from any GDAL-supported elevation raster 
.IP "\fB\fBaspect\fP\fP" 1c
to generate an aspect map from any GDAL-supported elevation raster 
.IP "\fB\fBcolor-relief\fP\fP" 1c
to generate a color relief map from any GDAL-supported elevation raster 
.IP "\fB\fBTRI\fP\fP" 1c
to generate a map of Terrain Ruggedness Index from any GDAL-supported elevation raster 
.IP "\fB\fBTPI\fP\fP" 1c
to generate a map of Topographic Position Index from any GDAL-supported elevation raster 
.IP "\fB\fBroughness\fP\fP" 1c
to generate a map of roughness from any GDAL-supported elevation raster 
.PP
.PP
The following general options are available : 
.IP "\fB\fIinput_dem\fP:\fP" 1c
The input DEM raster to be processed 
.IP "\fB\fIoutput_xxx_map\fP:\fP" 1c
The output raster produced 
.IP "\fB\fB-of\fP \fIformat\fP:\fP" 1c
Select the output format\&. The default is GeoTIFF (GTiff)\&. Use the short format name\&. 
.IP "\fB\fB-compute_edges\fP:\fP" 1c
(GDAL >= 1\&.8\&.0) Do the computation at raster edges and near nodata values 
.IP "\fB\fB-alg\fP \fIZevenbergenThorne\fP:\fP" 1c
(GDAL >= 1\&.8\&.0) Use Zevenbergen & Thorne formula, instead of Horn's formula, to compute slope & aspect\&. The literature suggests Zevenbergen & Thorne to be more suited to smooth landscapes, whereas Horn's formula to perform better on rougher terrain\&. 
.IP "\fB\fB-b\fP \fIband\fP:\fP" 1c
Select an input \fIband\fP to be processed\&. Bands are numbered from 1\&. 
.IP "\fB\fB-co\fP \fI'NAME=VALUE'\fP:\fP" 1c
Passes a creation option to the output format driver\&. Multiple \fB-co\fP options may be listed\&. See format specific documentation for legal creation options for each format\&. 
.IP "\fB\fB-q\fP:\fP" 1c
Suppress progress monitor and other non-error output\&. 
.PP
.PP
For all algorithms, except color-relief, a nodata value in the target dataset will be emitted if at least one pixel set to the nodata value is found in the 3x3 window centered around each source pixel\&. The consequence is that there will be a 1-pixel border around each image set with nodata value\&. From GDAL 1\&.8\&.0, if -compute_edges is specified, gdaldem will compute values at image edges or if a nodata value is found in the 3x3 window, by interpolating missing values\&.
.SH "Modes"
.PP
.SS "hillshade"
This command outputs an 8-bit raster with a nice shaded relief effect\&. It’s very useful for visualizing the terrain\&. You can optionally specify the azimuth and altitude of the light source, a vertical exaggeration factor and a scaling factor to account for differences between vertical and horizontal units\&.
.PP
The value 0 is used as the output nodata value\&.
.PP
The following specific options are available : 
.IP "\fB\fB-z\fP \fIzFactor\fP:\fP" 1c
vertical exaggeration used to pre-multiply the elevations 
.IP "\fB\fB-s\fP \fIscale\fP:\fP" 1c
ratio of vertical units to horizontal\&. If the horizontal unit of the source DEM is degrees (e\&.g Lat/Long WGS84 projection), you can use scale=111120 if the vertical units are meters (or scale=370400 if they are in feet) 
.IP "\fB\fB-az\fP \fIazimuth\fP:\fP" 1c
azimuth of the light, in degrees\&. 0 if it comes from the top of the raster, 90 from the east, \&.\&.\&. The default value, 315, should rarely be changed as it is the value generally used to generate shaded maps\&. 
.IP "\fB\fB-alt\fP \fIaltitude\fP:\fP" 1c
altitude of the light, in degrees\&. 90 if the light comes from above the DEM, 0 if it is raking light\&. 
.IP "\fB\fB-combined\fP \fIcombined shading\fP:\fP" 1c
(starting with GDAL 1\&.10) a combination of slope and oblique shading\&. 
.PP
.SS "slope"
This command will take a DEM raster and output a 32-bit float raster with slope values\&. You have the option of specifying the type of slope value you want: degrees or percent slope\&. In cases where the horizontal units differ from the vertical units, you can also supply a scaling factor\&.
.PP
The value -9999 is used as the output nodata value\&.
.PP
The following specific options are available : 
.IP "\fB\fB-p\fP :\fP" 1c
if specified, the slope will be expressed as percent slope\&. Otherwise, it is expressed as degrees 
.IP "\fB\fB-s\fP \fIscale\fP:\fP" 1c
ratio of vertical units to horizontal\&. If the horizontal unit of the source DEM is degrees (e\&.g Lat/Long WGS84 projection), you can use scale=111120 if the vertical units are meters (or scale=370400 if they are in feet) 
.PP
.SS "aspect"
This command outputs a 32-bit float raster with values between 0° and 360° representing the azimuth that slopes are facing\&. The definition of the azimuth is such that : 0° means that the slope is facing the North, 90° it's facing the East, 180° it's facing the South and 270° it's facing the West (provided that the top of your input raster is north oriented)\&. The aspect value -9999 is used as the nodata value to indicate undefined aspect in flat areas with slope=0\&.
.PP
The following specifics options are available : 
.IP "\fB\fB-trigonometric\fP:\fP" 1c
return trigonometric angle instead of azimuth\&. Thus 0° means East, 90° North, 180° West, 270° South 
.IP "\fB\fB-zero_for_flat\fP:\fP" 1c
return 0 for flat areas with slope=0, instead of -9999 
.PP
.PP
By using those 2 options, the aspect returned by gdaldem aspect should be identical to the one of GRASS r\&.slope\&.aspect\&. Otherwise, it's identical to the one of Matthew Perry's aspect\&.cpp utility\&.
.SS "color-relief"
This command outputs a 3-band (RGB) or 4-band (RGBA) raster with values are computed from the elevation and a text-based color configuration file, containing the association between various elevation values and the corresponding wished color\&. By default, the colors between the given elevation values are blended smoothly and the result is a nice colorized DEM\&. The -exact_color_entry or -nearest_color_entry options can be used to avoid that linear interpolation for values that don't match an index of the color configuration file\&.
.PP
The following specifics options are available : 
.IP "\fB\fIcolor_text_file\fP:\fP" 1c
text-based color configuration file 
.IP "\fB\fB-alpha\fP :\fP" 1c
add an alpha channel to the output raster 
.IP "\fB\fB-exact_color_entry\fP :\fP" 1c
use strict matching when searching in the color configuration file\&. If none matching color entry is found, the '0,0,0,0' RGBA quadruplet will be used 
.IP "\fB\fB-nearest_color_entry\fP :\fP" 1c
use the RGBA quadruplet corresponding to the closest entry in the color configuration file\&. 
.PP
.PP
The color-relief mode is the only mode that supports VRT as output format\&. In that case, it will translate the color configuration file into appropriate LUT elements\&. Note that elevations specified as percentage will be translated as absolute values, which must be taken into account when the statistics of the source raster differ from the one that was used when building the VRT\&.
.PP
The text-based color configuration file generally contains 4 columns per line : the elevation value and the corresponding Red, Green, Blue component (between 0 and 255)\&. The elevation value can be any floating point value, or the \fInv\fP keyword for the nodata value\&.\&. The elevation can also be expressed as a percentage : 0% being the minimum value found in the raster, 100% the maximum value\&.
.PP
An extra column can be optionally added for the alpha component\&. If it is not specified, full opacity (255) is assumed\&.
.PP
Various field separators are accepted : comma, tabulation, spaces, ':'\&.
.PP
Common colors used by GRASS can also be specified by using their name, instead of the RGB triplet\&. The supported list is : white, black, red, green, blue, yellow, magenta, cyan, aqua, grey/gray, orange, brown, purple/violet and indigo\&.
.PP
Since GDAL 1\&.8\&.0, GMT \&.cpt palette files are also supported (COLOR_MODEL = RGB only)\&.
.PP
Note: the syntax of the color configuration file is derived from the one supported by GRASS r\&.colors utility\&. ESRI HDR color table files (\&.clr) also match that syntax\&. The alpha component and the support of tab and comma as separators are GDAL specific extensions\&.
.PP
For example : 
.PP
.nf
3500   white
2500   235:220:175
50%   190 185 135
700    240 250 150
0      50  180  50
nv     0   0   0   0 

.fi
.PP
.SS "TRI"
This command outputs a single-band raster with values computed from the elevation\&. TRI stands for Terrain Ruggedness Index, which is defined as the mean difference between a central pixel and its surrounding cells (see Wilson et al 2007, Marine Geodesy 30:3-35)\&.
.PP
The value -9999 is used as the output nodata value\&.
.PP
There are no specific options\&.
.SS "TPI"
This command outputs a single-band raster with values computed from the elevation\&. TPI stands for Topographic Position Index, which is defined as the difference between a central pixel and the mean of its surrounding cells (see Wilson et al 2007, Marine Geodesy 30:3-35)\&.
.PP
The value -9999 is used as the output nodata value\&.
.PP
There are no specific options\&.
.SS "roughness"
This command outputs a single-band raster with values computed from the elevation\&. Roughness is the largest inter-cell difference of a central pixel and its surrounding cell, as defined in Wilson et al (2007, Marine Geodesy 30:3-35)\&.
.PP
The value -9999 is used as the output nodata value\&.
.PP
There are no specific options\&.
.SH "C API"
.PP
Starting with GDAL 2\&.1, this utility is also callable from C with GDALDEMProcessing()\&.
.SH "AUTHORS"
.PP
Matthew Perry perrygeo@gmail.com, Even Rouault even.rouault@mines-paris.org, Howard Butler hobu.inc@gmail.com, Chris Yesson chris.yesson@ioz.ac.uk
.PP
Derived from code by Michael Shapiro, Olga Waupotitsch, Marjorie Larson, Jim Westervelt : U\&.S\&. Army CERL, 1993\&. GRASS 4\&.1 Reference Manual\&. U\&.S\&. Army Corps of Engineers, Construction Engineering Research Laboratories, Champaign, Illinois, 1-425\&.
.SH "See also"
.PP
Documentation of related GRASS utilities :
.PP
http://grass.osgeo.org/grass64/manuals/html64_user/r.slope.aspect.html
.PP
http://grass.osgeo.org/grass64/manuals/html64_user/r.shaded.relief.html
.PP
http://grass.osgeo.org/grass64/manuals/html64_user/r.colors.html 
